<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <script src="../../configure.js"></script>
</head>
<body style="background-color: #F5F6F7">
<div class="container" style="background-color:white;margin-top: 20px">
<!--    method="post" action="../addAdminPage.do"-->
    <form id="form" style="margin:10px 0px 10px">
        <span style="font-size:larger;color: black">添加快递</span>
        <hr style="border: black 1px solid">
        <div class="form-group">
            <label for="sendName">寄件人姓名:</label>
            <input type="text" class="form-control" name="sendName" id="sendName" placeholder="请输入寄件人姓名">
        </div>
        <div class="form-group">
            <label for="sendPhone">寄件人电话:</label>
            <input type="text" class="form-control" name="sendPhone" id="sendPhone" placeholder="请输入寄件人电话">
        </div>
        <div class="form-group">
            <label for="sendProvince">寄件人所属省份:</label>
            <input type="text" class="form-control" name="sendProvince" id="sendProvince" placeholder="请输入寄件人所属省份">
        </div>
        <div class="form-group">
            <label for="sendCity">寄件人所属市:</label>
            <input type="text" class="form-control" name="sendCity" id="sendCity" placeholder="请输入寄件人所属市">
        </div>
        <div class="form-group">
            <label for="sendArea">寄件人所属区:</label>
            <input type="text" class="form-control" name="sendArea" id="sendArea" placeholder="请输入寄件人所属区">
        </div>
        <div class="form-group">
            <label for="sendAddressDetail">寄件人详情地址:</label>
            <input type="text" class="form-control" name="sendAddress" id="sendAddressDetail" placeholder="请输入寄件人详情地址">
        </div>
        <div class="form-group">
            <label for="receiveName">收件人姓名:</label>
            <input type="text" class="form-control" name="receiveName" id="receiveName" placeholder="请输入收件人姓名">
        </div>
        <div class="form-group">
            <label for="receivePhone">收件人电话:</label>
            <input type="text" class="form-control" name="receivePhone" id="receivePhone" placeholder="请输入收件人电话">
        </div>

        <div class="form-group">
            <label for="receiveProvince">收件人所属省份:</label>
            <input type="text" class="form-control" name="receiveProvince" id="receiveProvince" placeholder="请输入收件人所属省份">
        </div>
        <div class="form-group">
            <label for="receiveCity">收件人所属市:</label>
            <input type="text" class="form-control" name="receiveCity" id="receiveCity" placeholder="请输入收件人所属市">
        </div>
        <div class="form-group">
            <label for="receiveArea">收件人所属区:</label>
            <input type="text" class="form-control" name="receiveArea" id="receiveArea" placeholder="请输入收件人所属区">
        </div>
        <div class="form-group">
            <label for="receiveAddressDetail">收件人详情地址:</label>
            <input type="text" class="form-control" name="receiveAddress" id="receiveAddressDetail" placeholder="请输入收件人详情地址">
        </div>
        <div class="form-group">
            <label for="weight">重量:</label>
            <input type="number" class="form-control" name="weight" id="weight" min="1" placeholder="请输入快递重量">
        </div>
        <div class="form-group">
            <label for="remark">寄件备注:</label>
            <textarea class="form-control" name="remark" id="remark" placeholder="请输入寄件备注"></textarea>
        </div>
    </form>
    <button class="btn btn-primary form-control" id="submit">添加</button>
</div>
<script src="../js/jquery-3.3.1.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/distpicker.data.js"></script>
<script src="../js/distpicker.js"></script>
<script type="text/javascript">
    $("#submit").click(function () {
        var formData=$("#form").serialize()
        console.log(formData)
        $.post(url +"/admin/pageAdd",formData,function (data) {
            console.log(data)
            if(data.code==1){
                alert("添加成功")
                location.href="test.html"
            }else if(data.code==0){
                alert("添加失败")
            }
    },"json")
  })
</script>

</body>
</html>